#
# Copyright (c) 2010, Monash e-Research Centre
#   (Monash University, Australia)
# Copyright (c) 2010, VeRSI Consortium
#   (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#    *  Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#    *  Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#    *  Neither the name of the VeRSI, the VeRSI Consortium members, nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.auth.views import login, logout

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
	(r'^$', 'tardis.tardis_portal.views.index'),		
	(r'^about/$', 'tardis.tardis_portal.views.about'),	
	(r'^help/$', 'tardis.tardis_portal.views.help'),
	(r'^totaldatasize/$', 'tardis.tardis_portal.views.totaldatasize'),	
	(r'^file_transfer/$', 'tardis.tardis_portal.views.file_transfer'),	
	(r'^new_params/$', 'tardis.tardis_portal.views.new_params'),										
	(r'^experiment/view/(?P<experiment_id>\d+)/$', 'tardis.tardis_portal.views.view_experiment'),
	(r'^experiment/view/$', 'tardis.tardis_portal.views.experiment_index'),				
	(r'^experiment/register/$', 'tardis.tardis_portal.views.register_experiment_ws_xmldata'),
	(r'^experiment/view/(\d+)/download/$', 'tardis.tardis_portal.views.download'),	
	(r'^experiment/view/(\d+)/downloadExperiment/$', 'tardis.tardis_portal.views.downloadExperiment'),		
	(r'^search/experiment/$', 'tardis.tardis_portal.views.search_experiment'),	
	(r'^search/datafile/$', 'tardis.tardis_portal.views.search_datafile'),	
	(r'^displayDatasetImage/(?P<dataset_id>\d+)/(?P<parameter_name>\w+)/$', 'tardis.tardis_portal.views.display_dataset_image'),
	(r'^displayDatafileImage/(?P<dataset_file_id>\d+)/(?P<parameter_name>\w+)/$', 'tardis.tardis_portal.views.display_datafile_image'),	
	# (r'^search/quick/$', 'tardis.tardis_portal.views.search_quick'),	
	(r'^ajax/parameters/(?P<dataset_file_id>\d+)/$', 'tardis.tardis_portal.views.retrieve_parameters'),
		(r'^ajax/xml_data/(?P<dataset_file_id>\d+)/$', 'tardis.tardis_portal.views.retrieve_xml_data'),	
	(r'^ajax/datafile_list/(?P<dataset_id>\d+)/$', 'tardis.tardis_portal.views.retrieve_datafile_list'),	
	(r'^login/$', 'tardis.tardis_portal.views.login'),
	(r'^logout/$', 'tardis.tardis_portal.views.logout'),
	(r'^accounts/', include('registration.urls')),
	(r'site_media/(?P<path>.*)$', 'django.views.static.serve',
	        {'document_root': settings.STATIC_DOC_ROOT}),
	(r'media/(?P<path>.*)$', 'django.views.static.serve',
	        {'document_root': settings.ADMIN_MEDIA_STATIC_DOC_ROOT}),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/(.*)', admin.site.root),
)
